package com.grad.webstudy.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.grad.webstudy.constants.CourseTypeConstants;

import java.io.Serializable;
import java.util.Date;

/**
 * @Description:
 * @Author: zjf
 * @Date: 2020/3/24 19:16.
 */
public class CourseTypeVo implements Serializable {

    private Integer id;

    private String typeName;

    private Integer parentId = CourseTypeConstants.PARENT_ID;


    private String creator;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    private int type;


    private String parentName;

    private String typeVo;


    @Override
    public String toString() {
        return "CourseTypeVo{" +
                "id=" + id +
                ", typeName='" + typeName + '\'' +
                ", parentId=" + parentId +
                ", creator='" + creator + '\'' +
                ", createTime=" + createTime +
                ", type=" + type +
                ", parentName='" + parentName + '\'' +
                ", typeVo='" + typeVo + '\'' +
                '}';
    }

    public CourseTypeVo() {
    }

    public CourseTypeVo(Builder builder) {
        this.id = builder.id;
        this.typeName = builder.typeName;
        this.parentId = builder.parentId;
        this.creator = builder.creator;
        this.createTime = builder.createTime;
        this.type = builder.type;
        this.parentName = builder.parentName;
        this.typeVo = builder.typeVo;
    }

    public String getTypeVo() {
        return typeVo;
    }

    public void setTypeVo(String typeVo) {
        this.typeVo = typeVo;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    public static class Builder {
        private Integer id;

        private String typeName;

        private Integer parentId = CourseTypeConstants.PARENT_ID;


        private String creator;

        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date createTime;

        private int type;


        private String parentName;

        private String typeVo;

        public Builder setId(Integer id) {
            this.id = id;
            return this;
        }

        public Builder setTypeName(String typeName) {
            this.typeName = typeName;
            return this;
        }

        public Builder setParentId(Integer parentId) {
            this.parentId = parentId;
            return this;
        }

        public Builder setCreator(String creator) {
            this.creator = creator;
            return this;
        }

        public Builder setCreateTime(Date createTime) {
            this.createTime = createTime;
            return this;
        }

        public Builder setType(int type) {
            this.type = type;
            return this;
        }

        public Builder setParentName(String parentName) {
            this.parentName = parentName;
            return this;
        }

        public Builder setTypeVo(String typeVo) {
            this.typeVo = typeVo;
            return this;
        }

        public CourseTypeVo build() {
            return new CourseTypeVo(this);
        }
    }
}
